<template>
  <img src="../../../../../assets/images/back.png" alt="" :style="styleColor" @click="goback">
</template>

<script>
import { removeScreenItem } from '@/utils/screenStorage.js'
export default {
    props: {    //仿照超链，props项保留
        value: Object,
        ispreview: Boolean
    },
    data(){
        return {
            options: {},
        }
    },
    computed: {
        transStyle() {
            return this.objToOne(this.options);
        },
        styleColor() {
            return {
                position: this.ispreview ? "absolute" : "static",
                background: this.transStyle.background,
                width: this.transStyle.width + "px",
                height: this.transStyle.height + "px",
                left: this.transStyle.left + "px",
                top: this.transStyle.top + "px",
                right: this.transStyle.right + "px"

            }
        }
    },
    mounted(){
        this.options = this.value;

    },
    methods:{
        goback(){
            // console.log('返回')
      
            // console.log(this.value)
            if (this.value||this.value.setup.layerName =='secondBack') {
                removeScreenItem()
            }
  
            this.$router.back()
        }
    }
}
</script>

<style scoped lang="scss">

</style>